{include file="public/header" /}
<style type="text/css">
/*强制table不换行*/
table td{word-break: keep-all;white-space:nowrap;}
table th{word-break: keep-all;white-space:nowrap;}
.laydate-icon {
    background: transparent !important;
}
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5><font style="color:green">{$customer.nickname}</font> 的历史订单列表</h5>
            <h5 style="float:right">
                <a href="javascript:history.go(-1)" style="color:green">返回 ></a></h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->           
            <div class="row">
                <div class="col-sm-12">
                    <div class="table-responsive">
                        <div class="col-sm-12">
                            <form method="post" action="{:url('historyOrderList', ['customer_id'=>$customer.id])}" class="form-inline">
                                <label for="">支付时间：</label>
                                <input id="orderPayTime" name="orderPayTime" style="width: 220px;" class="form-control"
                                        autocomplete="off" value="{$orderPayTime|default=''}">

                                <label for="">订单状态：</label>
                                {:getEnumSelectWidget(config("enum.ddkOrderStatus"), 'order_status', '-请选择订单状态-', isset($order_status) ? $order_status : '-999', 1)}

                                <label for="">ID：</label>
                                <input type="text" name="id" value="{$id|default=''}" class="form-control">
                                
                                <label for="">推广位</label>
                                <input type="text" name="yx_pid" value="{$yx_pid|default=''}" class="form-control">

                                <br><br>

                                <label for="">微信名</label>
                                <input type="text" name="nickname" value="{$nickname|default=''}" class="form-control">


                                <label for="">商品名</label>
                                <input type="text" name="goods_name" value="{$goods_name|default=''}" class="form-control">

                                <label for="">订单号</label>
                                <input type="text" name="order_sn" value="{$order_sn|default=''}" class="form-control">
                                <button class="btn btn-success btn-sm" type="submit" style="margin-bottom:0;margin-left:4px"><i class="fa fa-filter"></i> 筛选</button>
                                <a class="btn btn-primary btn-sm"  style="margin-bottom:0" href="{:url('historyOrderList', ['customer_id'=>$customer.id])}"><i class="fa fa-filter"></i> 重置</a>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <div style="overflow-x:scroll;width:100%;">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
                                <th>昵称</th>
                                <th>支付时间</th>
                                <th>订单号</th>
                                <th>推广位</th>
                                <th>商品信息</th>
                                <th>订单状态</th>
                                <th>付款金额</th>
                                <th>订单预估佣金收入(元)</th>
                            </tr>
                        </thead>
                        <tbody id="list-content">
                            {foreach $list as $vo}
                                <tr class="long-td">
                                    <td>{$customer["nickname"]}</td>
                                    <td>{$vo["order_pay_time"]}</td>
                                    <td>{$vo["order_sn"]}</td>
                                    <td>{$customer["yx_pid"]}</td>
                                    <td>{$vo["goods_name"]}</td>
                                    <td>{:getEnumString(config('enum.ddkOrderStatus'), $vo.order_status)}</td>
                                    <td>{$vo["order_amount"]}</td>
                                    <td>
                                        {if $vo.first_customer_id == $vo.id}
                                            {$vo.first_customer_profit}
                                        {elseif $vo.second_customer_id == $vo.id}
                                            {$vo.second_customer_profit}
                                        {elseif $vo.third_customer_id == $vo.id}
                                            {$vo.third_customer_profit}
                                        {else /}
                                            --
                                        {/if}
                                    </td>
                                </tr>
                            {/foreach}
                        </tbody>
                    </table>
                    </div>
                    {$list->render()|raw}
                </div>
            </div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>

{include file="public/footer" /}
<script type="text/javascript">
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        // 年月范围
        laydate.render({
          elem: "#orderPayTime",
          type: 'date',
          range: true
        });

    });
</script>

</body>
</html>